//
//  SessionMember.swift
//  app_rn_frontend
//
//  Created by 鱼涛 on 2017/12/14.
//  Copyright © 2017年 Facebook. All rights reserved.
//

import Foundation
import WCDBSwift

final class SessionMember: TableCodable {
  static let table = "session_member"

  var id:Int = 0
  var userId:Int = 0
  var sessionId:Int = 0
  var name:String? = nil
  var remarkName:String? = nil
  var me:Int = 0
  var createdDatetime:String? = nil
  var deleted:Int = 0

  enum CodingKeys: String, CodingTableKey {
    typealias Root = SessionMember
//    static let objectRelationalMapping = TableBinding(CodingKeys.self)
    case id
    case userId = "user_id"
    case sessionId = "session_id"
    case name
    case remarkName = "remark_name"
    case me
    case createdDatetime = "created_datetime"
    case deleted

      static let objectRelationalMapping = TableBinding(CodingKeys.self) {
          BindColumnConstraint(.id, isPrimary: true, isAutoIncrement: true)
      }
      
//    static var columnConstraintBindings: [CodingKeys: ColumnConstraintBinding]? {
//      return [.id: ColumnConstraintBinding(isPrimary: true, isAutoIncrement: true)]
//    }
  }

  var isAutoIncrement: Bool = true
  var lastInsertedRowID: Int = 0
}
